<script>
//引入JS文件，同时指定下拉和上报地址
export default {
  globalData: {
    text: "text",
  },
  onLaunch: function () {
    // //初始化
    // #ifdef H5
    //this.$users.checkLogin(undefined,this._route.path);
    // #endif

    // #ifdef MP-WEIXIN
    const updateManager = uni.getUpdateManager();
    updateManager.onCheckForUpdate(function (res) {
      // 请求完新版本信息的回调
      console.log("hasUpdate：" + res.hasUpdate);
    });

    updateManager.onUpdateReady(function (res) {
      uni.showModal({
        title: "更新提示",
        content: "新版本已经准备好，是否重启应用？",
        success(res) {
          if (res.confirm) {
            // 新的版本已经下载好，调用 applyUpdate 应用新版本并重启
            updateManager.applyUpdate();
          }
        },
      });
    });

    updateManager.onUpdateFailed(function (res) {
      console.log("新版本下载失败");
      console.log(res);
    });
    // #endif

    this.$common.removeStorage("PopupContents");
  },
  onShow: function () {
    console.log("App Show");
  },
  onHide: function () {
    console.log("App Hide");
  },
};
</script>

<style lang="scss">
/*每个页面公共css */
@import "./common/css/uni.css";
@import "./common/css/weui.scss";
@import "./common/css/common.scss";
@import "./common/css/style-class.min.css";
@import "./common/css/iconfont.css";
@import "./common/css/reset.css";

/* #ifdef H5 */
uni-button:after {
  border: 0px;
}
uni-checkbox .uni-checkbox-input {
  border-radius: 50%;
}
uni-checkbox .uni-checkbox-input.uni-checkbox-input-checked {
  background-color: $uni-theme-color;
  color: #ffffff;
  border-color: $uni-theme-color;
}
uni-checkbox .uni-checkbox-input.uni-checkbox-input-checked:before {
  color: #ffffff;
}
uni-radio .uni-radio-input.uni-radio-input-checked {
  background-color: $uni-theme-color;
  color: #ffffff;
  border-color: $uni-theme-color;
}
uni-radio .uni-radio-input.uni-radio-input-checked:before {
  color: #ffffff;
}
uni-view img {
  opacity: 1;
  max-width: 100%;
}
uni-swiper .uni-swiper-dot-active {
  background-color: $uni-theme-color;
  width: 20px;
  border-radius: 5px;
}
.swiper-box .uni-swiper-dots-horizontal {
  left: 15%;
  bottom: 40upx;
}
/* #endif */

/* #ifdef APP-PLUS || MP-WEIXIN */
.swiper-box .wx-swiper-dot-active {
  background-color: #ffffff;
  width: 20px;
  border-radius: 5px;
}
.swiper-box .wx-swiper-dots-horizontal {
  left: 15%;
  bottom: 40upx;
}
wx-button:after {
  border: 0px;
}
checkbox .wx-checkbox-input {
  border-radius: 50%;
}
checkbox .wx-checkbox-input.wx-checkbox-input-checked {
  background-color: $uni-theme-color;
  border-color: $uni-theme-color;
  color: #ffffff;
}
checkbox .wx-checkbox-input.wx-checkbox-input-checked:before {
  color: #ffffff;
}

radio .wx-radio-input.wx-radio-input-checked {
  background-color: $uni-theme-color;
  border-color: $uni-theme-color;
  color: #ffffff;
}
radio .wx-radio-input.wx-radio-input-checked:before {
  color: #ffffff;
}
/* #endif */
</style>
